package com.zhglxt.oa.activitiListeners.taskListener;

import org.activiti.engine.delegate.DelegateTask;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;

import java.io.Serializable;

@Component("testExpression")
public class BusinessTripTaskListenerExpression implements Serializable {

    private final Logger logger= LoggerFactory.getLogger(BusinessTripTaskListenerExpression.class);

    /**
     * 测试并查看源码，发现与方法名无关，但方法中需要TaskEntity,TaskEntity是DelegateTask的实现类，所以传入DelegateTask接口即可
     * @param
     */
    public void execute1(DelegateTask delegateTask){

        logger.info("BusinessTripTaskListenerExpression测试");
        String processInstanceId = delegateTask.getProcessInstanceId();
        logger.info("监听的获取的流程发布processInstanceId:{}",processInstanceId);


//        logger.info("当前的流程实例id是：{}",delegateTask.getProcessInstanceId());
//        logger.info("当前流程的创建时间是：{}",delegateTask.getCreateTime());
    }
}
